﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true"
    CodeBehind="HostMail.aspx.cs" Inherits="Framework.WebmasterTool.HostMail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="Server">
    Cấu hình mail server
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="Server">
    <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel ID="Panel1" runat="server" Visible="true">
        <asp:Label ID="lblMessage" runat="server" Font-Bold="true"></asp:Label>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="Label1" runat="server" Text="SMTP Server Mail Host:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSmtp" runat="server" Width="290px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Chưa nhập SMTP Server Mail Host"
                                ControlToValidate="txtSmtp" Display="Dynamic"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text="SMTP Server Mail Port:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSmtpPort" runat="server" Width="290px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Chưa nhập SMTP Server Mail Port"
                                Display="Dynamic" ControlToValidate="txtSmtpPort"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtSmtpPort"
                                Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="9999" ErrorMessage="Port phải là số nguyên"></asp:RangeValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label6" runat="server" Text="IMAP Server Mail Host:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImap" runat="server" Width="290px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Chưa nhập IMAP Server Mail Host"
                                ControlToValidate="txtImap" Display="Dynamic"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label7" runat="server" Text="IMAP Server Mail Port:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtImapPort" runat="server" Width="290px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Chưa nhập IMAP Server Mail Port"
                                Display="Dynamic" ControlToValidate="txtImapPort"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="txtImapPort"
                                Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="9999" ErrorMessage="Port phải là số nguyên"></asp:RangeValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="Tài khoản email chính:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtUsername" runat="server" Width="290px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Chưa nhập Email trung gian"
                                Display="Dynamic" ControlToValidate="txtUsername"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                Display="Dynamic" runat="server" ControlToValidate="txtUsername" ErrorMessage="Tài khoản mail không chính sác"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label4" runat="server" Text="Mật khẩu:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPassword" runat="server" Width="290px" TextMode="Password"></asp:TextBox>
                            <asp:Label ID="lblMessagePass" runat="server" ForeColor="Blue"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label5" runat="server" Text="Mail trung gian:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtEmailTo" runat="server" Width="290px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Chưa nhập Email chính"
                                Display="Dynamic" ControlToValidate="txtEmailTo"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                Display="Dynamic" runat="server" ControlToValidate="txtEmailTo" ErrorMessage="Tài khoản mail không chính sác"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            SSL:
                        </td>
                        <td>
                            <asp:CheckBox ID="chkSSL" runat="server" Text="Bật SSL" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:Button ID="btnSave" runat="server" Text="Cập nhật" OnClick="btnSave_Click" />
                            <asp:Button ID="btnTestMail" runat="server" Text="Kiêm tra kết nối mail" OnClick="btnTestMail_Click" />
                        </td>
                    </tr>
                </table>
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
                    <ProgressTemplate>
                        <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0;
                            right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
                            <img src="<%= DGSFramework.Globals.ApplicationPath %>WebmasterTool/Images/ajax-loader.gif"
                                alt="Loading ..." title="Loading ..." style="padding: 10px; position: fixed;
                                top: 45%; left: 45%" />
                        </div>
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnTestMail" EventName="Click" />
                <asp:PostBackTrigger ControlID="btnSave" />
            </Triggers>
        </asp:UpdatePanel>
    </asp:Panel>
</asp:Content>
